program main
    implicit none
    real, external  :: mul
    real, intrinsic :: sin           ! 声明sin为库函数
    call func(mul)
    call func(sin)
end program main

subroutine func(f)                   ! 将函数作为子程序的参数
    implicit none                    
    real, external :: f
    write(*, *) f(1.0)
    return                          
end subroutine


real function mul(num)
    implicit none                   
    real :: num
    mul = num * 2
    return                     
end function